package io;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

public class TestNote {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos=new FileOutputStream("note.txt");
        Scanner scan=new Scanner(System.in);
        System.out.println("请输入内容，输入exit时退出");
        while (true){
            String name=scan.next();
            if ("exit".equals(name)){
                System.out.println("已退出");
                break;
            }
//            String line=new String(name);
//            byte[] bytes=line.getBytes(StandardCharsets.UTF_8);
            fos.write(name.getBytes(StandardCharsets.UTF_8));
        }
        fos.close();

    }
}
